An electric discharge machining apparatus machines a workpiece into a desired shape by moving tool electrode with respect to a workpiece in accordance with a programmed machining path while material is removed from the workpiece by an electric discharge generated by applying a voltage across the tool electrode and the workpiece. In the machining operation performed by this electric discharge machining apparatus, an electric discharge machining condition must be kept constant. The electric discharge machining condition is provided by the average working voltage between the tool electrode and the workpiece (gap voltage), the time taken from the application of voltage across the tool electrode and the workpiece to the generation of electric discharge, or other factors. For this purpose, the electric discharging gap is adjusted by moving the tool electrode with respect to the workpiece in accordance with a detected electric discharge machining condition.
In the case of a conventional electric discharge machining control apparatus, the electric discharging gap is adjusted by giving a command for the position of retraction of the tool electrode to the position controller (hereinafter referred to as a servomechanism), the position of retraction being determined by the direction and distance of the relative retraction of the tool electrode from the workpiece depending on the detected electric discharge machining condition. Such retracting direction, for example, may be the direction opposite to the direction of the relative movement of the tool electrode with respect to the workpiece at the machining position, or the direction perpendicular to the direction of the relative movement of a wire electrode with respect to the workpiece, that is, the direction normal to the work surface (e.g. in the case of the finishing on a wire electric discharge machine or the machining on a diesinking electric discharge machine). In place of these directions, the direction set in an orthogonal three-axis coordinate system is sometimes provided.
FIG. 6 is a block diagram showing the conventional relative feed control of the tool electrode with respect to the workpiece. In FIG. 6, reference numeral 1 denotes a tool electrode, and 2 denotes a workpiece. A gap condition detector 3 detects the electric discharge condition of the gap between the tool electrode 1 and the workpiece 2 (for example, detects the average working voltage). A command distribution mechanism 4 is composed of a digital differential analyzer (DDA) and the like in a numerical control unit to distribute command values to the positions commanded by a machining program. Numerical characters 5x, 5y, and 5z denote the servomechanisms for X, Y and Z axes, respectively; 6x, 6y and 6z denote servomotors; and 7x, 7y and 7z denote position detectors for detecting the rotational position of each servomotor. A transmission mechanism 8 moves the tool electrode 1 with respect to the workpiece 2 (FIG. 6 shows an example in which the tool electrode is moved by way of three servomotors 6x, 6y and 6z).
The gap condition detector 3 detects the condition between the tool electrode 1 and the workpiece 2, such as the average working voltage, and determines the deviation .di-elect cons. (=Vg-Vs) between the value Vg of the detected condition and the value Vs of the target (preset) condition. Then, the command value distribution mechanism 4 distributes the movement commands (M.sub.cx, M.sub.cy, M.sub.cz) to the servomechanisms 5x, 5y and 5z of each axis so that the tool electrode 1 moves to a position commanded by the machining program by a distance proportional to the value of the deviation e. The servomechanisms of the axes respectively drive the servomotors 6x, 6y and 6z of the corresponding axes so that the tool electrode 1 is moved with respect to the workpiece 2 through the transmission mechanism 8. The rotational position of each servomotor is detected by the position detectors 7x, 7y, 7z, and the feedback control of the position is performed by the servomechanisms 5x, 5y and 5z. The feedback control of speed is also performed by the servomechanisms 5x, 5y, and 5z.
FIG. 7 is a block diagram showing a tool electrode feed control, which is of a type somewhat different from the conventional type shown in FIG. 6. The difference from the method shown in FIG. 6 is that a distribution mechanism 4' is provided in addition to the command value distribution mechanism 4 for distributing movement commands to each axis, to thereby move the tool electrode 1 to the position commanded by the program.
In the tool electrode feed control shown in FIG. 7, the gap condition detector 3 detects the condition of the electric discharging gap (the size of the gap). The distribution mechanism 4' determines the movement amounts Px'. Py' and Pz' of X, Y and Z axes depending on the deviation .di-elect cons. (=Vg-Vs) between the detected value Vg and the preset target value Vs, and adds these amounts to the amounts, Px, Py and Pz distributed to each axis, which are outputted from the command value distribution mechanism 4, to issue the movement command to the servomotor of each axis.
With the tool electrode feed control method shown in FIGS. 6 and 7, the electric discharging gap is large, and therefore the value Vg of a detected condition is large accordingly. For this reason, when Vg-Vs=.di-elect cons.&gt;0 (Vs: target value), tool feed is controlled so that the tool electrode advances toward the workpiece by a distance proportional to the deviation .di-elect cons. to decrease the electric discharging gap. On the other hand, when the electric discharging gap is small, and therefore the value Vg of detected condition is small, that is, Vg-Vs =.di-elect cons.&lt;0, tool feed is controlled so that the tool electrode retracts away from the workpiece by a distance proportional to the deviation .di-elect cons. to increase the electric discharging gap. In either of the methods shown in FIGS. 6 and 7, the servomechanisms 5x, 5y, and 5z determine the movement speed of the tool electrode or the workpiece by comparing the current position with the target position outputted by the command value distribution mechanism 4 or the distribution mechanism 4' based on the electric discharge condition, and move the tool electrode or the workpiece.
In the electric discharge machining apparatus, in order to maintain normal electric discharge for removing the material from the workpiece, it is necessary for the electric discharging gap between the tool electrode and the workpiece to be kept at an appropriate value. For this purpose, therefore, it is necessary to adjust the electric discharging gap so that the tool electrode or the workpiece can be retracted (to widen the gap) for removing the chips of the workpiece accumulated during the machining of the workpiece using the electric discharge or for stopping the abnormal electric discharge for restoring normal electric discharge.
Specifically, for improving the material removal capability per unit time, it is necessary to rapidly detect the condition of electric discharging gap, which changes momentarily due to the progress of electric discharge machining and the accumulation of chips, for feeding back the detected conditions to the controller so as to restore the normal condition in a possible shortest time. Also, in order to restrain the increase in abnormality, it is effective to take actions for solving the problems as rapidly as possible when chips are accumulated or abnormal electric discharge has occurred. Therefore, the control unit, which moves the tool electrode or the workpiece in accordance with the detected electric discharge condition, must have a high response to provide high electric discharge machining efficiency and to decrease the abnormality of machining.
However, as described above, in the case of the conventional electric discharge machining control apparatus, the command value distribution mechanism 4 commands the movement amounts M.sub.cx, M.sub.cy and M.sub.cz for the tool electrode 1 or the workpiece 2, and so the response of the control apparatus cannot be increased due to the following reasons.
First, the command value distribution mechanism 4 must perform calculations to distribute movement amounts (Px, Py, Pz) and thereby maintain an optimum electric discharging gap for a drive mechanism of plural axes (X, Y, and Z axes) consisting of servomotors and feed screws. Moreover, regarding the movement path of the tool electrode, which is programmed in advance, work is needed to determine whether or not the current tool position has reached its end point or the boundary point of individual movement units. For this reason, the calculation time required for the distribution of movement command values to each axis cannot be decreased beyond the time taken for the above processing; the processing time has a lower limit value. Thus, the period in which the calculation for command value distribution is performed must be a time interval larger than the aforementioned lower limit value. Therefore, the time elapsing from the time when the electric discharging gap condition is observed to the time when the next calculation for command value distribution is performed will be wasted, producing a delay.
Further, when the given command is for a very small movement; the servomechanisms 5x, 5y and 5z make the follow-up movement only at a very low speed proportional to the commanded amount of movement (since the gain is usually adjusted to prevent the overshooting), and so their movements delay by the time equivalent to the inverse number of the position feedback control gain, which is a constant of the proportionality.
The servomechanisms 5x, 5y and 5z respectively constitute closed loops, in which the information concerning the rotational position of each servomotor is fed back from the position detectors 7x, 7y and 7z, and so when the position control gain is increased, the gain margin will decrease, thereby causing the performance of each servomechanism to become unstable. For this reason, the position control gain cannot be increased indiscriminately. Therefore, it is difficult to decrease the delay time, and the follow-up delay time of servomechanism lowers the response of the control of electric discharging gap.
To improve the response of the servomechanism, the feedforward control of position is sometimes applied. In this method, the value proportional to the value obtained by differentiating the movement commands Px, Py and Pz, issued from the command value distribution mechanism 4, is added to the speed command obtained by the normal position loop processing to provide the speed command for the speed loop processing. Even this feedforward control is not good enough to compensate the time delay occurring before the command value distribution mechanism 4 performs calculation for distribution to determine the movement command amount of each axis. Moreover, since the differentiation of the movement command is actually made by dividing the deviation of movement commands distributed for each command time interval (distribution period) by the command time interval, the accuracy of the differentiated value deteriorates in proportion to the command time interval. Therefore, in the case of the feedforwarding control, the weight of the portion based on the differentiated value in the speed command value cannot be increased. Thus, there is a limit in increasing the response of electric discharge control even if the feedforward control is used.
As discussed above, ill carrying Out the electric discharge machining, various conventional methods of electric discharging gap control are not good enough for obtaining and adequately effective response, thereby causing inadequate operating efficiency and inadequate protection against abnormal machining.